﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ERPStore.Extensions;

using CloudSoft.Extensions;

namespace ERPStore.Payment.Direct.Services
{
	public class SandboxCouponProvider : ERPStore.Services.ICouponProvider
	{
		#region ICouponProvider Members

		public IEnumerable<ERPStore.Models.IDiscount> GetDiscountList()
		{
			var sandboxPaymentService = GlobalConfiguration.Configuration.DependencyResolver.GetService<SandBoxPaymentService>();
			if (sandboxPaymentService != null
				&& !sandboxPaymentService.CouponCode.IsNullOrTrimmedEmpty())
			{
				var coupon = new Models.SandboxCoupon();
				coupon.Code = sandboxPaymentService.CouponCode;
				return new List<ERPStore.Models.IDiscount>() { coupon };
			}
			return null;
		}

		#endregion
	}
}
